package com.example.smartgreenhouse.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartgreenhouse.entity.EnvironmentCurrent;
import org.apache.ibatis.annotations.Update;

public interface EnvironmentCurrentMapper extends BaseMapper<EnvironmentCurrent> {
    
    @Update("UPDATE environment_current SET " +
            "current_value = #{currentValue}, " +
            "current_change_value = #{currentChangeValue}, " +
            "current_change_rate = #{currentChangeRate}, " +
            "collect_time = #{collectTime} " +
            "WHERE sensor_id = #{sensorId} AND metric_type = #{metricType}")
    int updateCurrentValue(EnvironmentCurrent entity);
}